﻿using FoodModel;
using J.FoodManageGet.Application.Command.TableNumCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageGet.Application.CommandHandler.TableNumCommandHandler
{
    public class TableNumIDCommandHandler : IRequestHandler<TableNumIDCommand, List<TableNumModel>>
    {
        private readonly ITableNumRepository _tableNumRepository;

        public TableNumIDCommandHandler(ITableNumRepository tableNumRepository)
        {
            _tableNumRepository = tableNumRepository;
        }
        public async Task<List<TableNumModel>> Handle(TableNumIDCommand request, CancellationToken cancellationToken)
        {
            var list = await _tableNumRepository.NumIdShow(request.TableNumId);
            return list;
        }
    }
}
